<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>消息列表条目管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
<div class="main-content">
    <tags:breadcrumb menuId="图文消息列表" />
    <div class="page-content">
        <table id="contentTable" class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th>消息类型</th>
                <th>公众号</th>
                <th>文章标题</th>
                <th>文章简述</th>
                <th>缩略图</th>
                <th>URL</th>
                <th>是否显示</th>
                <th>更新时间</th>
                <shiro:hasPermission name="wechat:weiXinNewListItem:edit">
                    <th>操作</th>
                </shiro:hasPermission></tr>
            </thead>
            <tbody>
            <c:forEach items="${page.list}" var="weiXinNewListItem">
                <tr>
                    <td>${weiXinNewListItem.typeName}</td>
                    <td>${weiXinNewListItem.accountName}</td>
                    <td><a href="${ctx}/wechat/weiXinNewListItem/form?id=${weiXinNewListItem.id}">${weiXinNewListItem.title}</a></td>
                    <td>${weiXinNewListItem.description}</td>
                    <td><img src="${weiXinNewListItem.picUrl}" width="100" height="100"/></td>
                    <td><a href="${weiXinNewListItem.url}" target="_blank">查看原文</a></td>
                    <td>${fns:getDictLabel(weiXinNewListItem.isShow,'yes_no' ,'是')}</td>
                    <td><fmt:formatDate value="${weiXinNewListItem.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <shiro:hasPermission name="wechat:weiXinNewListItem:edit"><td>
                        <a href="${ctx}/wechat/weiXinNewListItem/form?id=${weiXinNewListItem.id}">修改</a>
                        <a href="javascript:;" onclick="deleteMsg('确认要删除该文本消息模板吗？','${ctx}/wechat/weiXinNewListItem/delete?id=${weiXinNewListItem.id}',this);">删除</a>
                    </td></shiro:hasPermission>
                </tr>
            </c:forEach>
            </tbody>
        </table>
        <div class="pagination">${page}</div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {

    });

    //删除
    function deleteMsg(msg,href,tr){
        layer.confirm(msg,function(index){
            layer.close(index);
            loading();
            $.post(href,function(data){
                if(data.success){
                    showNote("success", function () {
                        $(tr).parent().parent().remove();
                    }, data.msg, "center");
                }else {
                    showNote("error", function () {
                        return false;
                    }, data.msg);
                }
            });
        });
    }

    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
</body>
</html>
